﻿namespace Grow.Domain.Repository
{
    /// <summary>
    /// 工作单元
    /// </summary>
    public interface IUnitOfWork : IDisposable
    {

        /// <summary>
        /// 获取数据上下文
        /// </summary>
        /// <returns></returns>
        IDbContext DbContext { get; }

        /// <summary>
        /// 异步提交当前上下文的事务更改
        /// </summary>
        /// <returns></returns>
        Task CommitAsync(CancellationToken cancellationToken = default);
    }
}
